package wang.lx.mybatis.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;

import wang.lx.mybatis.entity.SysUser;
import wang.lx.mybatis.mapper.SysUserMapper;

/**
 * 系统用户服务
 */
@Service
public class SysUserService extends SysUserTokenService  implements SysUserServiceI{
    
    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public SysUser findUserByUser(SysUser query) {
        PageHelper.startPage(1, 2);
        List<SysUser> users = this.sysUserMapper.queryAllByLimit(null,query);
        if(users.size()==1){
            return users.get(0);
        }
        else if(users.size()>1)
        {
            throw new RuntimeException("查询结果大于1");
        }
        return null;
    }

    

}
